# - Find PCRE++
# Find the native PCREPP includes and library
# This module defines
#  PCREPP_INCLUDE_DIR, where to find jpeglib.h, etc.
#  PCREPP_LIBRARIES, the libraries needed to use PCREPP.
#  PCREPP_FOUND, If false, do not try to use PCREPP.
# also defined, but not for general use are
#  PCREPP_LIBRARY, where to find the PCREPP library.

FIND_PATH(PCREPP_INCLUDE_DIR pcre++.h
/usr/local/include
/usr/include
)

SET(PCREPP_NAMES ${PCREPP_NAMES} pcre++)
FIND_LIBRARY(PCREPP_LIBRARY
  NAMES ${PCREPP_NAMES}
  PATHS /usr/lib /usr/local/lib
  )

IF (PCREPP_LIBRARY AND PCREPP_INCLUDE_DIR)
    SET(PCREPP_LIBRARIES ${PCREPP_LIBRARY})
    SET(PCREPP_FOUND "YES")
ELSE (PCREPP_LIBRARY AND PCREPP_INCLUDE_DIR)
  SET(PCREPP_FOUND "NO")
ENDIF (PCREPP_LIBRARY AND PCREPP_INCLUDE_DIR)


IF (PCREPP_FOUND)
   IF (NOT PCREPP_FIND_QUIETLY)
      MESSAGE(STATUS "Found PCRE++: ${PCREPP_LIBRARIES}")
   ENDIF (NOT PCREPP_FIND_QUIETLY)
ELSE (PCREPP_FOUND)
   IF (PCREPP_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find PCRE++ library")
   ENDIF (PCREPP_FIND_REQUIRED)
ENDIF (PCREPP_FOUND)

# Deprecated declarations.
SET (NATIVE_PCREPP_INCLUDE_PATH ${PCREPP_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_PCREPP_LIB_PATH ${PCREPP_LIBRARY} PATH)

MARK_AS_ADVANCED(
  PCREPP_LIBRARY
  PCREPP_INCLUDE_DIR
  )

